<%-- 
    Document   : ExamenActualizar
    Created on : 10/10/2011, 04:26:44 PM
    Author     : Alumnos
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="java.sql.*" %>
<%@page import="java.util.*" %>

<%
    Connection conn = null;
    try {
        String sc = "jdbc:mysql://localhost:3306/upeu?user=root&password=";
        Class.forName("com.mysql.jdbc.Driver");
        conn = DriverManager.getConnection(sc);
        System.out.println("Conectado");
        
        %>
        
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <form action="ExamenActualizar2.jsp">
            <table>
     <%  
                    String userid = request.getParameter("userid");
                    String qry = "select * from user where userid='" +userid+ "'";
                    PreparedStatement ps = conn.prepareStatement(qry);
                    ResultSet rs = ps.executeQuery();
                while (rs.next())  {%>   
           <tr>
           <th colspan="2"  scope="col">Actualizar Tabla</th>                   
           <input type="password" name="userid" id="userid" value="<%= userid%>">
           </tr>  
           
           
                <tr>
                    <td>Name</td>
                    <td><input type="text" name="nombre" id="nombre" value="<%= rs.getString("nombre")%>"/></td>      
                </tr>

                <tr>
                    <td>Photo</td>
                    <td><input type="text" name="photo" id="photo" value="<%= rs.getString("photo")%>"/></td>                
                </tr>

                <tr>
                    <td>Email</td>
                    <td><input type="text" name="email" id="email" value="<%= rs.getString("email")%>"/></td>                
                </tr>
               
                <tr>
                    <td>Cellular</td>
                    <td><input type="text" name="celular" id="celular" value="<%= rs.getString("celular")%>"/></td>                
                </tr>
                  <tr>
                    <td>Login</td>
                    <td><input type="text" name="login" id="login" value="<%= rs.getString("login")%>"/></td>                
                </tr>
                <tr>
                    <td>Password</td>
                    <td><input type="password" name="Password" id="Password" value="<%= rs.getString("Password")%>"/></td>                
                </tr>
                 <tr>
                    <td>Privilege</td>
                    <td><input type="text" name="Privilege" id="Privilege" value="<%= rs.getString("Privilege")%>"/></td>                
              
                
                </tr>
                <td>ActiveAccount</td>
                    <td><input type="text" name="activeAccount" id="activeAccount" value="<%= rs.getString("activeaccount")%>"/></td>                
                </tr>
                <tr>
                    <td>ForcePasswordChange</td>
                    <td><input type="text" name="ForcePasswordChange " id="ForcePasswordChange " value="<%= rs.getString("forcepasswordchange")%>"/></td>                
                </tr>
                 <tr>
                    <td>DateCreate</td>
                    <td><input type="text" name="DateCreate " id="DateCreate "  value="<%= rs.getString("datecreate")%>"/></td>                
                </tr>

            </table>
           
           
           <tr>
                <input type="submit" value="Actualizar"/>         
            </tr>
   
    </body>   
</html>
      <%              
        } }catch (Exception e) {
                    out.print("Error: " + e.getMessage());
                }
      %>
